/*
 * Copyright (c) 2022  by Junzhao
 * THIS FILE IS PART OF JAVASE Song Huongkang PROJECT
 * All Rights Reserved.
 */

package 练习.工资系统;

import java.util.Scanner;
/**
 * @description
 * @author 俊昭
 * @date 2022/4/7
*/
public class PayrollSystem {
    public static void main(String[] args) {

        Scanner sc =new Scanner(System.in);
        System.out.println("请输入当前月份");
        int month=sc.nextInt();
        sc.close();

        Employee[] emps=new Employee[2];

        emps[0]=new SalariedEmployee("A",1001,new MyDate(2000,1,2),9000);// 多态
        emps[1]=new HourlyEmployee("B",1000,new MyDate(2002,8,7),55,200);

        for(Employee i:emps){
            System.out.println(i);
//            System.out.println("月工资为："+i.earning());
            if(i.getBirthday().getMonth()==month){
                System.out.println("生日快乐 奖励一百元！");
                System.out.println("月工资为："+(i.earning()+100)+"￥");
            }else{
                System.out.println("月工资为："+i.earning()+"￥");
            }

        }
    }
}
